//
//  VC3TabBarControllerSecond.swift
//  ChapterAll
//
//  Created by Kevin on 2020/4/23.
//  Copyright © 2020 Kevin. All rights reserved.
//

import UIKit

class VC3TabBarControllerSecond: UIViewController {
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        
    }
    
    override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
        
        let vc0 = getVc(index: 0)
        let vc1 = getVc(index: 1)
        
        let tab = UITabBarController()
        tab.viewControllers = [vc0,vc1]
        present(tab, animated: true, completion: nil)
    }
    
    func getVc(index:Int) -> UIViewController {
        let vc = UIViewController()
        let index0 = UITabBarItem(tabBarSystemItem: .downloads, tag: index)
        vc.tabBarItem = index0
        return vc
    }
}
